1. Field of the Invention
This invention relates to a method of detecting the degree of correlation, and in particular to a method of detecting the degree of correlation which is improved in detection accuracy and which detects the correlation between image signals or the like and is thereby suitable for a distance detecting device in an automatic control instrument such as a robot, or an auto-focus device applied in the field of the camera or the like.
2. Related Background Art
Detecting the phase relation between two signal trains to thereby detect the degree of correlation therebetween is widely known. Detection of such degree of correlation is used for various purposes, and in such cases, two object image signals obtained from an object are used as the signal trains and from the detection of the correlation between the two signals, the distance to the object is measured, and this is applied to auto-focus devices. For example, as a method of the focus detecting device of a camera, there is known a method whereby the relative deviation between two images formed by dividing the pupil of the photo-taking lens is observed to thereby discriminate the in-focus state. U.S. Pat. No. 4,185,191 discloses, for example, a device wherein a fly-eye lens group is disposed on the predetermined imaging plane of the photo-taking lens of a camera generate two images deviated relative from each other, the deviation corresponding to the amount of defocus of the photo taking lens. Also, Japanese Laid-open patent application Nos. 118019/1980 and 155331/1980 disclose a so-called secondary imaging method whereby aerial images formed on said predetermined imaging plane by two juxtaposed secondary imaging systems are directed to the surface of a solid state image sensor to thereby detect the relative the positional deviation of the respective images. The latter secondary imaging method requires a somewhat great length, but has merit that in it does not require any special optical system.
The principle of this secondary imaging method will hereinafter be briefly described with reference to FIG. 1 of the accompanying drawings. A field lens 2 is disposed coaxially with a photo-taking lens 1 to be focused, and two secondary imaging lenses 3a, 3b are juxtaposed rearwardly of the field lens 2, and light-receiving sensors 4a, 4b are disposed rearwardly of the secondary imaging lenses 3a, 3b. Designated by 5a and 5b are stops provided near the secondary imaging lenses 3a and 3b. The field lens 2 causes the exit pupil of the photo-taking lens 1 to be substantially imaged on the pupil planes of the two secondary imaging lenses 3a and 3b. As a result, light ray fluxes entering the secondary imaging lenses 3a and 3b are those emerging from the regions of equal area on the exit pupil plane of the photo-taking lens 1 which correspond to the respective secondary imaging lenses 3a and 3b and which do not overlap each other. When aerial images formed near the field lens 2 are re-formed on the surfaces of the sensors 4a and 4b by the secondary imaging lenses 3a and 3b, the two re-formed images change their positions on the basis of the difference between the positions in the direction of the optic axis at which said aerial images are formed.
FIG. 2 of the accompanying drawings shows the manner in which such phenomenon occurs. About the in-focus state of FIG. 2A, there are the near focus and the far focus states as in FIGS. 2B and 2C and in these respecitve states, the two images formed on the surfaces of the sensors 4a and 4b move in the opposite direction on the surfaces of the sensors 4a and 4b. If this image intensity distribution is photoelectrically converted by the sensors 4a and 4b and the amount of relative positional deviation of said two images i.e., the degree of correlation between said two images, is detected by the use of an electrical processing circuit, discrimination of the in-focus state can be accomplished.
Various operating and processing methods for detecting the degree of correlation between two images from photoelectrically converted signals have also heretofore been devised. For example, according to Japanese Laid-Open patent application No. 45510/1982, when two photoelectrically converted signals are a(i) and b(i) (i=1, . . . , N), processing according to the relation ##EQU1## is operated and, when the the two images have become coincident with each other, V(d)=0 and from this, the phase difference d between the two images can be known. The result of the operation of equation (1) having been carried out for the phtoelectrically converted signals (a)i and b(i) as shown, for example, in FIG. 3 of the accompanying drawings is shown in FIG. 4 of the accompanying drawings. It is seen from this that the two images of FIG. 3 have the point of V(d)=0, i.e., the phase difference of d=-2.5 picture elements.
Another operating and processing method is disclosed in Japanese Laid-open patent application No. 107313/1984. That is, the operating method disclosed in this patent application is ##EQU2## wherein {x,y} and max {x,y} are the operators which select the smaller or greater value of x and y. V(m) according to equation (2) or (3), as in equation (1), has such a nature that V(d)=0 when the two images have become coincident with each other, whereby the phase difference between the two images, i.e., the degree of correlation d between the two images, can be detected.
To find a d which is V(d)=0 in reality, it is considered that d which is V(d)=0 exists in a section wherein the sign of V(m) is inverted, for example, in the case of FIG. 4, between [-3 and -2], and d is often found from the values of V(-2) and V(-3) by the straight interpolation. In this case, V(-2)=-300 and V(-3)=250, and d=-3+V(-3)/[V(-3)-V(-2)].apprxeq.-2.5.
Equations (1) to (3) are the correlation function of the two signals in a broad sense, and in a correlation function of a finite length, the signal area which is the subject of the operation varies with a variable m, as is well known. Therefore, with respect to the signals as shown in FIG. 3 wherein there is no variation in brightness at the ends of the signals, or in other words, there is no information at the ends of the signals, the degree of correlation (the phase difference) can be properly detected by a correlation operation, but in signals wherein there is information also at the ends of the signals as in an ordinary object to be photographed, the information of another signal corresponding to the end of one signal shifts from the operation subject area with the variable m and at that time, an error may be induced. The reason for this will hereinafter be described with reference to FIGS. 5 and 6 of the accompanying drawings.
The image signals of FIG. 5, like the signals of FIG. 3, have a phase difference of -2.5 picture elements, but unlike the signals of FIG. 3, the ends of the image signals of FIG. 5 have reasonable brightness information. The process in which the operation of equation (1) is carried out for these signals is shown in FIGS. 6A-6D of the accompanying drawings. As previously described, the phase difference between these two signals can be found by a straight line interpolation between the values of V(-3) and V(-2). FIGS. 6A and 6B correspond to the first term and the second term, respectively, of ##EQU3## Likewise, FIGS. 6C and 6D correspond to the first term and the second term, respectively, of ##EQU4## Here, if V(-3) and V(-2) are actually calculated V(-3)=350 and V(-2)=-450, and the straight-line interpolated value thereof is d.apprxeq.-2.6 and, when this is compared with the right phase difference, there is an error of 0.1 picture elements. The reason for this is that for V(-2), a signal b(3) was included in the operation subject area, whereas for V(-3), it departed from the subject.
As noted above, the edge portion information in the cut-out signal of a finite length may often cause an error in the operation of the degree of correlation, and it adversely affects not only the operation of the degree of correlation, but also generally the signal processing and therefore, a kind of weight function called a "time window" is often applied to the signal to thereby reduce the signal level of the edge portion of the signal in advance. The process of it will now be described with reference to FIGS. 7 and 8 of the accompanying drawings.
FIG. 7 shows the manner in which a weight function as indicated by C therein is applied to the same object signals a(i) and b(i) as those of FIG. 5. That is, EQU a'(i)=w(i).multidot.a(i) (4) EQU b'(i)=w(i).multidot.b(i) (5)
where i=1, . . . , 14, W(1)=w(14)=0.25, w(2)=w(13)=0.5, w(3)=w(12)=0.75 and w(j)=1.0(j=4, . . . , 11). The process in which the operation of the degree of correlation is carried out for such signals a'(i) and b'(i) is shown in FIG. 8. Like FIG. 6, FIGS. 8A and 8B correspond to the case of V(-3) and FIGS. 8C and 8D correspond to the case of V(-2). Here, if the values of V(-3) and V(-2) are calculated, V(-3)=225 and V(-2)=-337.5 and thus, d=-2.6 and in the case of such object signals and weight function, the error cannot be reduced. The reason for this is that the correlation operation has been effected by multiplying the signals by the weight function only in the no phase difference state of FIG. 7 and therefore the edge portion information of the signal b'(i) in FIG. 8D is not sufficiently attenuated. That is, in the state in the vicinity of the in-focus state wherein the phase difference between the two signals is little, the signal levels of the edge portions of the two signals attenuate in a similar manner and therefore, the effect of the weight function is obtained, but in the signals having a great phase difference therebetween as shown in FIG. 7, the information of one signal corresponding to the edge portion of another signal is not at the end and therefore, it is often the case that the effect of the weight is not obtained.
Although an example of the prior art in which an electrical weight is applied to photoelectrically converted signals has been described with respect to FIGS. 7 and 8, other examples of the prior art in which the same effect is realized by the shape of an optical filter or element are disclosed, for example, in Japanese Laid-open patent applications Nos. 149007/1980 and 87250/1980.
FIG. 9 of the accompanying drawings illustrates the method of Japanese Laid-open patent application No. 149007/1980 in which the signal levels of a picture element of the opposite ends of the same two object signals as those of FIG. 5 are reduced to a half by the effect of an optical filter. The process in which the correlation operation is effected for such signals is shown in FIG. 10 of the accompanying drawings. Like FIG. 6, FIGS. 10A and 10B correspond to the case of V(-3) and FIGS. 10C and 10D correspond to the case of V(-2). Here, if the values of V(-3) and V(-2) are actually calculated, V(-3)=275 and V(-2)=-475 and thus, d=-2.6 and, in the case of such object signals, the error cannot be reduced even if the signal levels of a picture element of the opposite ends are reduced to a half. The reason for this is that the signal levels of the edge portions have been reduced to a half only in the no phase difference state of FIG. 9 and therefore the signal level of the signal b(3) corresponding to the end in FIG. 10D is not reduced. That is, in the state in the vicinity of the in-focus state wherein the phase difference between the two signals is little, the signal levels of the edge portions of the two signals are reduced in a similar manner, whereas in the signals having a great phase difference therebetween as shown in FIG. 9, the information of one signal corresponding to the edge portion of another signal is not at the end and therefore, it is often the case that even if the signal of the edge portion is reduced to a half, the error cannot be mitigated. This problem holds true both in the case where said operation is effected by optical means and in the case where said operation is effected by electrical means.